<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>使用</title>
		<style>
			/*ul的第一个子元素*/
			ul li:first-child{
				background: red;
			}
			/*ul的最后一个元素*/
			ul li:last-child{
				background:hotpink;
			}
			/*body下面的第二个p元素*/				
			body p:nth-child(2){
			background: red;
			}
			ul li:nth-child(2) {
				background: #008000;
			}
			p:first-of-type{
				background: wheat;
			}
			p:last-of-type{
				background: yellow;
			}
			p:nth-of-type(3){
				background: deepskyblue;
			}
			span:first-of-type{
				background: mediumspringgreen;
			}
			span:last-of-type{
				background: #0000FF;
			}
		</style>
	</head>
	<body>
		<p>p1</p>
		<p>p2</p>
		<p>p3</p>
		<span>aa</span>
		<span>bb</span>
		<p>p4</p>
		<ul>
			<li>1i1</li>
			<li>1i2</li>
			<li>1i3</li>
		</ul>
	</body>
</html>
